package com.hncu.edu.info.manager.controller;

import com.hncu.edu.info.manager.domain.Student;

import java.util.Scanner;

//开闭原则
public class OtherStudentController extends BaseStudentController {
    private Scanner in = new Scanner(System.in);

    public OtherStudentController() {
    }

    //封装学生对象
    @Override
    public Student getStudent(String sid) {
        System.out.println("请输入姓名：");
        //接收新的名字
        String name = in.next();
        System.out.println("请输入年龄：");
        //新的年龄
        String age = in.next();
        System.out.println("请输入生日：");
        //新的生日
        String birthday = in.next();
        //封装一个新的对象
        Student stu = new Student(sid, name, age, birthday);
        //父类中的东西都存在
        return stu;
    }

}
